package com.example.hemin.fnb.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.hemin.fnb.R;
import com.example.hemin.fnb.ui.bean.OrderFromBean;

import java.util.List;

public class OrderFromAdapter extends BaseQuickAdapter<OrderFromBean, BaseViewHolder> {
    public OrderFromAdapter(int layoutResId, @Nullable List<OrderFromBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderFromBean item) {
                helper.setText(R.id.text,item.getPayType()).setText(R.id.text2,item.getName()).setText(R.id.text3,item.getPice()).setText(R.id.text4,item.getNumber())
                        .setText(R.id.text6,item.getType()).setText(R.id.text9,item.getTotal());
                if(item.getUsertype() ==0){
                    helper.getView(R.id.text10).setVisibility(View.GONE);
                    helper.getView(R.id.text11).setVisibility(View.GONE);
                    helper.getView(R.id.text12).setVisibility(View.VISIBLE);
                }else if(item.getUsertype() == 1){
                    helper.getView(R.id.text10).setVisibility(View.VISIBLE);
                    helper.getView(R.id.text11).setVisibility(View.VISIBLE);
                    helper.getView(R.id.text12).setVisibility(View.GONE);


                }

    }
}
